package sk.project.accounting.data.model;

// Generated Dec 17, 2012 9:50:06 PM by Hibernate Tools 3.4.0.CR1

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * CommodityType generated by hbm2java
 */
@Entity
@Table(name = "commodity_type", catalog = "skl_hosp_new")
public class CommodityType implements java.io.Serializable {

	private Integer id;
	private String name;
	private String shortcut;
	private Date updated;
	private Set<Commodity> commodities = new HashSet<Commodity>(0);

	public CommodityType() {
	}

	public CommodityType(String name, String shortcut, Date updated,
			Set<Commodity> commodities) {
		this.name = name;
		this.shortcut = shortcut;
		this.updated = updated;
		this.commodities = commodities;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@Column(name = "name", length = 200)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "shortcut", length = 20)
	public String getShortcut() {
		return this.shortcut;
	}

	public void setShortcut(String shortcut) {
		this.shortcut = shortcut;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "updated", length = 19)
	public Date getUpdated() {
		return this.updated;
	}

	public void setUpdated(Date updated) {
		this.updated = updated;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "commodityType")
	public Set<Commodity> getCommodities() {
		return this.commodities;
	}

	public void setCommodities(Set<Commodity> commodities) {
		this.commodities = commodities;
	}

}
